<?
	include("includes/config.php");
	include("includes/login.php");
	include("includes/functions.php");
?>
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="css/style.css" />
	</head>
	<body>
		<div id="header"><h1> <? echo detaliFirma('nume_firma'); ?></h1></div>
		<div id="warper">
			<?
				$resMeniu = mysql_query("select * from meniu");
			?>
			<div id="menu">
				<ul>
					<? while($rowMen = mysql_fetch_array($resMeniu)): ?>
					<li><a href="<?echo $rowMen['link'];?>"><? echo $rowMen['numeLink']; ?></a></li>
					<? endwhile; ?>
				</ul>
			</div>
			<div id="content">
				<div id="contentWrap">
					<h3>Adauga Masina Partenerului <b style="font-size:18px;color:#00a652"><? echo $_GET['nume_partener'];?></b></h3>
					
					<?
						
						if(@$_POST['masinaNoua']){
							 
								$id_client = $_GET['id_client'];
								$numar_inmatriculare = numarMasina($_POST['numarInmatriculare']);
								$numar_inmatriculare = strtoupper($numar_inmatriculare);
								$tipmasina = $_POST['tipmasina'];
								$nrkm = $_POST['nrkm'];
								$serievin = $_POST['serievin'];
								$seriemotor = $_POST['seriemotor'];
								$cp = $_POST['cp'];
								$combustibil = $_POST['combustibil'];
							
								#mysql_query("insert into parteneri_masini (id_masina,numar_inmatriculare,id_partener,nr_km,serie_caroserie,tip_masina,serie_motor,capacitate_cilindrica,tip_combustibil) values(NULL,'$numar_inmatriculare','$id_client','$nrkm','$serievin','$tipmasina','$seriemotor','$cp','$combustibil')") or die(mysql_error());
								header("Location:/comandanoua.php?id_client=".$id_client."&id_masina=". mysql_insert_id());
							
								
							
						}
					?>
					<form action="" method="post">
						<p>
							<label>Tip Masina</label>
							<input type="text" class="text" name="tipmasina" value="">
						</p>
						<p>
							<label>Numar Inmatriculare </label>
							<input type="text" class="text" name="numarInmatriculare" value="">
						</p>
						<p>
							<label>Numar Km</label>
							<input type="text" class="text" name="nrkm" value="">
						</p>
						<p>
							<label>Serie caroserie</label>
							<input type="text" class="text" name="serievin" value="">
						</p>
						<p>
							<label>Serie Motor</label>
							<input type="text" class="text" name="seriemotor" value="">
						</p>
						<p>
							<label>Capcitate cilindrica</label>
							<input type="text" class="text" name="cp" value="">
						</p>
						<p>
							<label>Tip Combustibil</label>
							<input type="text" class="text" name="combustibil" value="">
						</p>
						
						<p>
							<input class="buton" type="submit" name="masinaNoua" value="Deschide deviz/comanda masinii adaugate">
						</p>
					</form>
					<p><? mesaj(); ?></p>
					
					
				</div>
			</div>
		</div>
	</body>
</html>